package com.sansi.bleFloodlight.fragment;

import android.os.Bundle;
import android.view.View;

import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;


import com.my.httpapi.api.baseView.BaseFragment;
import com.sansi.bleFloodlight.R;
import com.sansi.bleFloodlight.adapter.HomeGroupAdapter;
import com.sansi.bleFloodlight.adapter.HomeLightAdapter;

import java.util.ArrayList;
import java.util.List;

public class HomeGroupFragment extends BaseFragment {
    private RecyclerView recyclerView;
    private HomeGroupAdapter homeGroupAdapter;
    private List<String> list=new ArrayList<>();

    public static Fragment newInstance() {
        return new HomeGroupFragment();
    }

    @Override
    protected void init(Bundle savedInstanceState) {
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
        recyclerView.setLayoutManager(linearLayoutManager);
        homeGroupAdapter = new HomeGroupAdapter();
        recyclerView.setAdapter(homeGroupAdapter);
        createData();
    }

    @Override
    protected int layout() {
        return R.layout.layout_fragment_home_group;
    }

    @Override
    protected void bindView(View view) {
        recyclerView = view.findViewById(R.id.recycler_view);
    }

    @Override
    protected void lazyLoad() {

    }

    @Override
    protected void lazyLoadOne() {

    }

    private void createData(){
        for(int i=0;i<4;i++){
            list.add("");
        }
        homeGroupAdapter.setNewData(list);
    }
}
